﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using COM.OA.BLL;
using COM.OA.Entity;
using System.Collections.Generic;

public partial class qs_wenjian_wenjianshanchu : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        int fid = Int32.Parse(this.Request.QueryString["f_id"]);

        files fs = filesBLL.Select(fid);
        if (fs.f_isreturn == 0)
        {
            filesBLL.Delete(fid);
            this.Response.Write(string.Format(GetRedirect.WINALERT, "删除成功"));
            this.Response.Write(string.Format(GetRedirect.REDIRECT, "jieshouwenjian.aspx"));
        }
        else 
        {
            string where = "fre_f_id='{0}'";
            where = string.Format(where, fid);
            IList<filerevert> list = filerevertBLL.Select(where);
            filerevert ft = list[0];
            int hid = ft.fre_id;
            filerevertBLL.Delete(hid);
            filesBLL.Delete(fid);
            this.Response.Write(string.Format(GetRedirect.WINALERT, "清除回复，并删除文件"));
            this.Response.Write(string.Format(GetRedirect.REDIRECT, "jieshouwenjian.aspx"));
        }

        
        
    }
}
